﻿<?php include $this->admin_tpl('meta');?>
</head>
<body>
<article class="page-container">
<div class="formdoby_normal"> 
	<form method="post" onsubmit="return dosub(this)">
	<div class="tabCon formdoby_info" style="display: block;">
		<div class="yzm-table-box">
		<table width="100%" class="table table-border yzmcms_table">
			<tbody>
			<tr>
				<td width="120"><span class="c-red">*</span>表格标题：</td> 
				<td>
				<input type="text" name="name" autocomplete="off" value="<?php echo $data['name'];?>" class="input-text" placeholder="表格标题">
				</td>
			</tr>
			<tr>
				<td width="120"><span class="c-red">*</span>表格名称：</td> 
				<td>
				<input type="text" name="type" autocomplete="off" value="<?php echo $data['type'];?>" <?php if($id){echo 'readonly style="background:#eee;"';}?> class="input-text" placeholder="请输入英文字母、数字组合的名称">
				</td>
			</tr>
			<tr>
				<td width="120"><span class="c-red">*</span>是否开启导出：</td> 
				<td>
					<span class="span_input">
						<label class="label_radio"><input name="is_download" type="radio" value="1" <?php if($data['is_download']){?>checked<?php }?>> 是</label>
						<label class="label_radio"><input name="is_download" type="radio" value="0" <?php if(!$data['is_download']){?>checked<?php }?>> 否</label>
					</span>
				</td>
			</tr>
			<tr>
				<td width="120"><span class="c-red">*</span>是否开启导入：</td> 
				<td>
					<span class="span_input">
						<label class="label_radio"><input name="is_upload" type="radio" value="1" <?php if($data['is_upload']){?>checked<?php }?>> 是</label>
						<label class="label_radio"><input name="is_upload" type="radio" value="0"<?php if(!$data['is_upload']){?>checked<?php }?>> 否</label>
					</span>
				</td>
			</tr>

			</tbody>
		</table>
		</div>
		<div style="height:30px;line-height:30px;padding:10px;">
			<div style="width:134px;" class="f-l"><span class="c-red">*</span>权限管理：</div> 
			<div class="f-l"><?php include $this->admin_tpl('jst_common/select_admin');?></div>
		</div>
	</div>
	<div class="footer_btn">
		<input type="hidden" name="dosubmit" value="1">
		<input type="hidden" name="id" value="<?php echo $id;?>">
		<input class="btn btn-primary radius" type="submit" value="提 交">
		<input class="btn btn-default radius" type="button" value="取 消" onclick="yzmcms_close()">	
	</div>
	</form>
</div>
</article>
<?php include $this->admin_tpl('footer');?>
<script type="text/javascript" src="<?php echo STATIC_URL;?>plugin/layui/layui.js"></script>
<script type="text/javascript">
function dosub(obj){
	$.ajax({
		type: 'POST',
		url: '<?php echo U('diy_set',['action'=>'add_table']);?>', 
		data: $(obj).serialize(),
		dataType: "json", 
		success: function (msg) {
			if(msg.status == 1){
				layer.msg(msg.message, {icon:1, time:800}, function(){
					parent.location.reload();
				});
			}else{
				layer.msg(msg.message, {icon:2});
			}
		}
	})		 
	return false;			 
}
</script> 

</body>
</html>